<template>
	<view class="identify-view">
		<view class="identify-title">请选择您的身份</view>
		<view class="identify-title-desc">让我们更精准的为您推送项目</view>
		<view class="fx-center-between identify-item" @click="changeCheck(index)" v-for="(item,index) in list"
			:key="index">
			<image :src="item.avatar" mode="heightFix" class="identify-avtr"></image>
			<view class="">
				<view class="item-title">{{item.label}}</view>
				<view class="">{{item.desc}}</view>
			</view>
			<radio :checked="checkIndex===index" color="#4078E5" />
		</view>
		<!-- <view class="fx-center-between identify-item" @click="changeCheck(2)">
			<image src="/static/identify_img2.png" mode="heightFix" class="identify-avtr"></image>
			<view class="">
				<view class="item-title">自媒体</view>
				<view class="">有独立推广/获客能力可以直接开展项目</view>
			</view>
			<radio :checked="checkIndex===2" color="#4078E5" />
		</view>
		<view class="fx-center-between identify-item" @click="changeCheck(3)">
			<image src="/static/identify_img3.png" mode="heightFix" class="identify-avtr"></image>
			<view class="">
				<view class="item-title">企业主</view>
				<view class="">为公司寻找优质项目，实现公司业务创收</view>
			</view>
			<radio :checked="checkIndex===3" color="#4078E5" />
		</view> -->
		<view class="identify-btn">
			<van-button block color="#4078E5" @click="toNext">下一步</van-button>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				checkIndex: 0,
				list: [],
				loginInfo: null
			};
		},
		onLoad(e) {
			if (e.info) {
				this.loginInfo = e.info
			}
			this.getInfo()
		},
		methods: {
			// 查询身份
			getInfo() {
				this.$api.requst(`/gwc/user/info_options`, {
					type: 1
				}).then((res) => {
					this.list = res.data
				})
			},
			changeCheck(index) {
				this.checkIndex = index
			},
			toNext() {
				uni.navigateTo({
					url: '/pages/login/chooseTags/chooseTags?type=' + this.list[this.checkIndex].value + '&info=' +
						this.loginInfo
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.identify-view {
		height: 100vh;
		background-color: #FFF;
		overflow: hidden;
		box-sizing: border-box;

		.identify-title {
			padding-top: 52rpx;
			font-size: 44rpx;
			font-weight: bold;
			text-align: center;
		}

		.identify-title-desc {
			color: #5C5F66;
			font-size: 30rpx;
			text-align: center;
			margin-bottom: 16rpx;
		}

		.identify-item {
			border: 0.5px solid #E2E2E2;
			margin: 32rpx 48rpx 0;
			padding: 32rpx;
			color: #5C5F66;
			font-size: 26rpx;

			.identify-avtr {
				width: 120rpx;
				height: 120rpx;
				margin-right: 32rpx;
				flex-shrink: 0;
			}

			.item-title {
				font-size: 34rpx;
				color: #161616;
				margin-bottom: 8rpx;
			}

			radio {
				margin-left: 30rpx;
			}
		}

		.identify-btn {
			position: fixed;
			bottom: 100rpx;
			left: 32rpx;
			right: 32rpx;
		}
	}
</style>